package com.umakr.ax.common.service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.umakr.ax.common.model.AutoMenu;
import com.umakr.ax.common.mapper.AutoMenuMapper;
import com.umakr.ax.core.base.BaseService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 * ${table.comment} 服务实现类
 * </p>
 *
 * @author Umakr-Code-Generator
 * @since 2017-12-30
 */
@Service
public class AutoMenuService extends BaseService<AutoMenuMapper, AutoMenu>{
    private  static final String STATUS= "status";

    public Object detail(Map<String, Object> param) {
        EntityWrapper<AutoMenu> entityWrapper = new EntityWrapper<>();
        entityWrapper.eq("rs_id", Long.parseLong(param.get("rsId").toString()));
        //1 生效(针对rsId唯一)
        entityWrapper.eq(STATUS, (param.get(STATUS) != null) ? Integer.parseInt(param.get(STATUS).toString()) : 1);
        return super.selectOne(entityWrapper);
    }
}
